home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Intercept
/
Visual Intercept.iso
/
sheriff.z
/
iscontfn.bas
< prev
next >
Wrap
BASIC Source File
|
1996-08-26
|
11KB
|
287 lines
Attribute VB_Name = "IIContact"
'----------------------------------------------------------------------------
' iscontfn.bas is a member of the Visual Intercept Visual Basic API.
' Copyright (c) 1996 Elsinore Technologies, Inc. All rights reserved.
'
' This software is protected by copyright law. Unauthorized reproduction
' or distribution of this program, or any portion of it, may result in
' severe civil or criminal penalties. If you have any questions about
' your redistribution rights, please contact Elsinore Technologies, Inc.
'
' Creator: Albert J. Lin (AJL)
' History: Created 09/17/95
'----------------------------------------------------------------------------
'----------------------------------------------------------------------------
' Visual Intercept Contact Declaration:
'----------------------------------------------------------------------------
Public Type VIContact
contactID As Long
firstName As String
lastName As String
address As String
city As String
state As String
region As String
country As String
zipCode As String
company As String
department As String
title As String
phonePrimary As String
phoneSecondary As String
pager As String
fax As String
email As String
description As String
type As String
End Type
Public Type IEContact
contactID As Long
lpFirstName As String
lpLastName As String
lpAddress As String
lpCity As String
lpState As String
lpRegion As String
lpCountry As String
lpZipCode As String
lpCompany As String
lpDepartment As String
lpTitle As String
lpPhonePrimary As String
lpPhoneSecondary As String
lpPager As String
lpFax As String
lpEmail As String
lpDescription As String
lpType As String
lnFirstName As Integer
lnLastName As Integer
lnAddress As Integer
lnCity As Integer
lnState As Integer
lnRegion As Integer
lnCountry As Integer
lnZipCode As Integer
lnCompany As Integer
lnDepartment As Integer
lnTitle As Integer
lnPhonePrimary As Integer
lnPhoneSecondary As Integer
lnPager As Integer
lnFax As Integer
lnEmail As Integer
lnDescription As Integer
lnType As Integer
End Type
'/* Contact API. */
Public Declare Function IIInsertContact Lib "isapi.dll" (pContact As IEContact) As Long
Public Declare Function IIDeleteContact Lib "isapi.dll" (pContact As IEContact, ByVal clause As String) As Long
Public Declare Function IIModifyContact Lib "isapi.dll" (pContact As IEContact, ByVal clause As String) As Long
Public Declare Function IIFetchContact Lib "isapi.dll" (pContact As IEContact, ByVal clause As String) As Long
Public Declare Function IIFetchContacts Lib "isapi.dll" (ByRef pnTotal As Long, ByVal clause As String) As Long
Public Declare Function IIGetContact Lib "isapi.dll" (pContact As IEContact, ByVal nIndex As Long) As Long
Public Function VBIIInitContact(contact As IEContact)
contact.lnFirstName = lnIIName
contact.lnLastName = lnIIName
contact.lnAddress = lnIIAddress
contact.lnCity = lnIICity
contact.lnState = lnIIState
contact.lnRegion = lnIIRegion
contact.lnCountry = lnIICountry
contact.lnZipCode = lnIIZipCode
contact.lnCompany = lnIICompany
contact.lnDepartment = lnIIDepartment
contact.lnTitle = lnIITitle
contact.lnPhonePrimary = lnIIPhone
contact.lnPhoneSecondary = lnIIPhone
contact.lnPager = lnIIPhone
contact.lnFax = lnIIPhone
contact.lnEmail = lnIIEMail
contact.lnDescription = lnIIDescription
contact.lnType = lnIIParameter
contact.contactID = 0
contact.lpFirstName = String(contact.lnFirstName, 0)
contact.lpLastName = String(contact.lnLastName, 0)
contact.lpAddress = String(contact.lnAddress, 0)
contact.lpCity = String(contact.lnCity, 0)
contact.lpState = String(contact.lnState, 0)
contact.lpRegion = String(contact.lnRegion, 0)
contact.lpCountry = String(contact.lnCountry, 0)
contact.lpZipCode = String(contact.lnZipCode, 0)
contact.lpCompany = String(contact.lnCompany, 0)
contact.lpDepartment = String(contact.lnDepartment, 0)
contact.lpTitle = String(contact.lnTitle, 0)
contact.lpPhonePrimary = String(contact.lnPhonePrimary, 0)
contact.lpPhoneSecondary = String(contact.lnPhoneSecondary, 0)
contact.lpPager = String(contact.lnPager, 0)
contact.lpFax = String(contact.lnFax, 0)
contact.lpEmail = String(contact.lnEmail, 0)
contact.lpDescription = String(contact.lnDescription, 0)
contact.lpType = String(contact.lnType, 0)
End Function
Public Function VBIIInsertContact(userContact As VIContact) As Long
Dim contact As IEContact
Dim err As Long
Call VBIIInitContact(contact)
Call VBIIPrepareContact(contact, userContact)
err = IIInsertContact(contact)
VBIIInsertContact = err
End Function
Public Function VBIIModifyContact(userContact As VIContact, ByRef clause As String) As Long
Dim contact As IEContact
Dim err As Long
Call VBIIInitContact(contact)
Call VBIIPrepareContact(contact, userContact)
err = IIModifyContact(contact, clause)
VBIIModifyContact = err
End Function
Public Function VBIIConvertContact(contact As IEContact, userContact As VIContact)
userContact.contactID = contact.contactID
userContact.firstName = contact.lpFirstName
userContact.lastName = contact.lpLastName
userContact.address = contact.lpAddress
userContact.city = contact.lpCity
userContact.state = contact.lpState
userContact.region = contact.lpRegion
userContact.country = contact.lpCountry
userContact.zipCode = contact.lpZipCode
userContact.company = contact.lpCompany
userContact.department = contact.lpDepartment
userContact.title = contact.lpTitle
userContact.phonePrimary = contact.lpPhonePrimary
userContact.phoneSecondary = contact.lpPhoneSecondary
userContact.pager = contact.lpPager
userContact.fax = contact.lpFax
userContact.email = contact.lpEmail
userContact.description = contact.lpDescription
userContact.type = contact.lpType
End Function
Public Function VBIIPrepareContact(contact As IEContact, userContact As VIContact)
contact.contactID = userContact.contactID
contact.lpFirstName = userContact.firstName
contact.lpLastName = userContact.lastName
contact.lpAddress = userContact.address
contact.lpCity = userContact.city
contact.lpState = userContact.state
contact.lpRegion = userContact.region
contact.lpCountry = userContact.country
contact.lpZipCode = userContact.zipCode
contact.lpCompany = userContact.company
contact.lpDepartment = userContact.department
contact.lpTitle = userContact.title
contact.lpPhonePrimary = userContact.phonePrimary
contact.lpPhoneSecondary = userContact.phoneSecondary
contact.lpPager = userContact.pager
contact.lpFax = userContact.fax
contact.lpEmail = userContact.email
contact.lpDescription = userContact.description
contact.lpType = userContact.type
contact.lnFirstName = Len(userContact.firstName)
contact.lnLastName = Len(userContact.lastName)
contact.lnAddress = Len(userContact.address)
contact.lnCity = Len(userContact.city)
contact.lnState = Len(userContact.state)
contact.lnRegion = Len(userContact.region)
contact.lnCountry = Len(userContact.country)
contact.lnZipCode = Len(userContact.zipCode)
contact.lnCompany = Len(userContact.company)
contact.lnDepartment = Len(userContact.department)
contact.lnTitle = Len(userContact.title)
contact.lnPhonePrimary = Len(userContact.phonePrimary)
contact.lnPhoneSecondary = Len(userContact.phoneSecondary)
contact.lnPager = Len(userContact.pager)
contact.lnFax = Len(userContact.fax)
contact.lnEmail = Len(userContact.email)
contact.lnDescription = Len(userContact.description)
contact.lnType = Len(userContact.type)
End Function
Public Function VBIIFetchContact(userContact As VIContact, ByRef clause As String) As Long
Dim contact As IEContact
Dim err As Long
Call VBIIInitContact(contact)
Call VBIIPrepareContact(contact, userContact)
err = IIFetchContact(contact, clause)
If err = 0 Then
Call VBIIConvertContact(contact, userContact)
End If
VBIIFetchContact = err
End Function
Public Function VBIIDeleteContact(userContact As VIContact, ByRef clause As String) As Long
Dim contact As IEContact
Dim err As Long
Call VBIIInitContact(contact)
Call VBIIPrepareContact(contact, userContact)
err = IIDeleteContact(contact, clause)
VBIIDeleteContact = err
End Function
Public Function VBIIFetchContacts(ByRef rnTotal As Long, ByRef clause As String) As Long
Dim err As Long
err = IIFetchContacts(rnTotal, clause)
VBIIFetchContacts = err
End Function
Public Function VBIIGetContact(userContact As VIContact, ByVal nIndex As Long) As Long
Dim contact As IEContact
Dim err As Long
Call VBIIInitContact(contact)
err = IIGetContact(contact, nIndex)
If err = 0 Then
Call VBIIConvertContact(contact, userContact)
End If
VBIIGetContact = err
End Function